home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 19
/
Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso
/
Aminet
/
comm
/
cnet
/
sysopnote3.lha
/
sysopnote3
/
Editor.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-03-15
|
9KB
|
161 lines
/**************************************************************************\
$VER: Sysop Note 3 Editor V2.0 - © Copyright Bulldog Productions 1997
\**************************************************************************/
options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; mg=maygetchar
a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
xc.1= 4;yc.1 = 1;ml.1=0;mr.1=2;mu.1=0;md.1=3;but.1='c7z4<<Save & Exit z0c7';bty.1=0
xc.2= 4;yc.2 = 23;ml.2=1;mr.2=0;mu.2=0;md.2=3;but.2='c7z4<<Exit Without Save z0c7';bty.2=0
xc.3= 6;yc.3 = 1;ml.3=0;mr.3=0;mu.3=1;md.3=4;but.3='c7z4Lowest Access Group :z0c7 ';bty.3=2;ans.3='0';le.3='68 2'
xc.4= 7;yc.4 = 1;ml.4=0;mr.4=0;mu.4=3;md.4=5;but.4='c7z4Highest Access Group :z0c7 ';bty.4=2;ans.4='31';le.4='68 2'
xc.5= 8;yc.5 = 1;ml.5=0;mr.5=0;mu.5=4;md.5=6;but.5='c7z4Amount Of Bulletins :z0c7 ';bty.5=2;ans.5='0' ;le.5='68 2'
xc.6= 10;yc.6 = 1;ml.6=0;mr.6=16;mu.6=5;md.6=7;but.6='c7z4Title One :z0c7 ';bty.6=2;ans.6='' ;le.6='4 25'
xc.7= 11;yc.7 = 1;ml.7=0;mr.7=17;mu.7=6;md.7=8;but.7='c7z4Title Two :z0c7 ';bty.7=2;ans.7='' ;le.7='4 25'
xc.8= 12;yc.8 = 1;ml.8=0;mr.8=18;mu.8=7;md.8=9;but.8='c7z4Title Three :z0c7 ';bty.8=2;ans.8='' ;le.8='4 25'
xc.9= 13;yc.9 = 1;ml.9=0;mr.9=19;mu.9=8;md.9=10;but.9='c7z4Title Four :z0c7 ';bty.9=2;ans.9='' ;le.9='4 25'
xc.10= 14;yc.10 = 1;ml.10=0;mr.10=20;mu.10=9;md.10=11;but.10='c7z4Title Five :z0c7 ';bty.10=2;ans.10='' ;le.10='4 25'
xc.11= 15;yc.11 = 1;ml.11=0;mr.11=21;mu.11=10;md.11=12;but.11='c7z4Title Six :z0c7 ';bty.11=2;ans.11='' ;le.11='4 25'
xc.12= 16;yc.12 = 1;ml.12=0;mr.12=22;mu.12=11;md.12=13;but.12='c7z4Title Seven :z0c7 ';bty.12=2;ans.12='' ;le.12='4 25'
xc.13= 17;yc.13 = 1;ml.13=0;mr.13=23;mu.13=12;md.13=14;but.13='c7z4Title Eight :z0c7 ';bty.13=2;ans.13='' ;le.13='4 25'
xc.14= 18;yc.14 = 1;ml.14=0;mr.14=24;mu.14=13;md.14=15;but.14='c7z4Title Nine :z0c7 ';bty.14=2;ans.14='' ;le.14='4 25'
xc.15= 19;yc.15 = 1;ml.15=0;mr.15=25;mu.15=14;md.15=26;but.15='c7z4Title Ten :z0c7 ';bty.15=2;ans.15='' ;le.15='4 25'
xc.16= 10;yc.16 = 47;ml.16=6;mr.16=0;mu.16=5;md.16=17;but.16='c7z4Edit Posting 1 z0c7';bty.16=0
xc.17= 11;yc.17 = 47;ml.17=7;mr.17=0;mu.17=16;md.17=18;but.17='c7z4Edit Posting 2 z0c7';bty.17=0
xc.18= 12;yc.18 = 47;ml.18=8;mr.18=0;mu.18=17;md.18=19;but.18='c7z4Edit Posting 3 z0c7';bty.18=0
xc.19= 13;yc.19 = 47;ml.19=9;mr.19=0;mu.19=18;md.19=20;but.19='c7z4Edit Posting 4 z0c7';bty.19=0
xc.20= 14;yc.20 = 47;ml.20=10;mr.20=0;mu.20=19;md.20=21;but.20='c7z4Edit Posting 5 z0c7';bty.20=0
xc.21= 15;yc.21 = 47;ml.21=11;mr.21=0;mu.21=20;md.21=22;but.21='c7z4Edit Posting 6 z0c7';bty.21=0
xc.22= 16;yc.22 = 47;ml.22=12;mr.22=0;mu.22=21;md.22=23;but.22='c7z4Edit Posting 7 z0c7';bty.22=0
xc.23= 17;yc.23 = 47;ml.23=13;mr.23=0;mu.23=22;md.23=24;but.23='c7z4Edit Posting 8 z0c7';bty.23=0
xc.24= 18;yc.24 = 47;ml.24=14;mr.24=0;mu.24=23;md.24=25;but.24='c7z4Edit Posting 9 z0c7';bty.24=0
xc.25= 19;yc.25 = 47;ml.25=15;mr.25=0;mu.25=24;md.25=26;but.25='c7z4Edit Posting 10z0c7';bty.25=0
xc.51= 4;yc.51 = 1;ml.51=0;mr.51=52;mu.51=0;md.51=0;but.51='c7z4Lose Changesz0c7';bty.51=0
xc.52= 4;yc.52 = 23;ml.52=51;mr.52=0;mu.52=0;md.52=0;but.52='c7z4Save Changesz0c7';bty.52=0
nb=25 /* Number Of buttons */
bn=1 /* Number Of First Button */
bu=1 /* Button To Start On */
if ~exists('pfiles:sysopnote3/details.data') then call DISBUT
else
do
call open(details,'pfiles:sysopnote3/details.data','R')
ans.3=readln(details);ans.4=readln(details);ans.5=readln(details);ans.6=readln(details)
ans.7=readln(details);ans.8=readln(details);ans.9=readln(details);ans.10=readln(details)
ans.11=readln(details);ans.12=readln(details);ans.13=readln(details);ans.14=readln(details)
ans.15=readln(details);call close details;end
call DISBUT
do until exi=1 /* Main Loop */
key=CHECK(GETCURSOR());oldbu=bu;select
when key=8&mu.bu>0 then call MOVE(mu.bu) /* Up */
when key=2&md.bu>0 then call MOVE(md.bu) /* Down */
when key=4&ml.bu>0 then call MOVE(ml.bu) /* Left */
when key=6&mr.bu>0 then call MOVE(mr.bu) /* Right */
when key='!' then exit /* Panic Exit */
when key='0d'x then select /* Return */
when bty.bu=0 then interpret('Call BUTTON'bu) /* Action Button */
when bty.bu=1 then do /* Toggle Button */
ans.bu=ans.bu=0;transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3'value('tog.'ans.bu);end
when bty.bu=2 then do /* String Button */
/* The 12 is the number of MCI codes in the Button string -1 */
transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3L1305640 #'ans.bu'}I'le.bu'}'
getuser 70;ans.bu=result;end
when bty.bu=3 then do /* Cycle Button */
ans.bu=(ans.bu+1)*((ans.bu+1)<mc.bu);transmit at(xc.bu,yc.bu+length(but.bu)-12)'c3'value(cnm.bu'.'ans.bu);end
otherwise do;Transmit 'f1n1No button-type defined for button #'bu' - Exiting!';exit;end
end
otherwise nop
end
end
exit
/* CODE FOR EACH BUTTON */
BUTTON1:
call open(details,'pfiles:sysopnote3/details.data','W')
call writeln details,ans.3;call writeln details,ans.4;call writeln details,ans.5
call writeln details,ans.6;call writeln details,ans.7;call writeln details,ans.8
call writeln details,ans.9;call writeln details,ans.10;call writeln details,ans.11
call writeln details,ans.12;call writeln details,ans.13;call writeln details,ans.14
call writeln details,ans.15;call close details;tr 'f1Saving!!!';
if ans.5='0' then address command 'delete pfiles:sysopnote3/details.data'
exi=1;return
BUTTON2:
nb=2; bn=51; bu=51; call DISBUT;return
BUTTON16:
WRITE:;CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/1';call DISBUT;return
BUTTON17:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/2';call DISBUT;return
BUTTON18:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/3';call DISBUT;return
BUTTON19:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/4';call DISBUT;return
BUTTON20:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/5';call DISBUT;return
BUTTON21:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/6';call DISBUT;return
BUTTON22:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/7';call DISBUT;return
BUTTON23:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/8';call DISBUT;return
BUTTON24:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/9';call DISBUT;return
BUTTON25:
CLS;CLEAREDITOR;CALLEDITOR 10;SAVEEDITOR 'pfiles:sysopnote3/messages/10';call DISBUT;return
BUTTON51:
exi=1;return
BUTTON52:
call open(details,'pfiles:sysopnote3/details.data','W')
call writeln details,ans.3;call writeln details,ans.4;call writeln details,ans.5
call writeln details,ans.6;call writeln details,ans.7;call writeln details,ans.8
call writeln details,ans.9;call writeln details,ans.10;call writeln details,ans.11
call writeln details,ans.12;call writeln details,ans.13;call writeln details,ans.14
call writeln details,ans.15;call close details;tr 'f1Saving!!!'
if ans.5='0' then address command 'delete pfiles:sysopnote3/details.data'
exi=1;return
DISBUT:;transmit 'f1>45}c4z7Sysop Note Version 3 Editor z0n1>45}z7Use cursor keys; ENTER to selectz0c7'
oldbu=bu;do a=bn to nb+bn-1;sendstring at(xc.a,yc.a)but.a'c3'
select;when bty.a=1 then transmit value('tog.'ans.a);when bty.a=2 then transmit ans.a
when bty.a=3 then transmit value(cnm.a'.'ans.a);otherwise nop;end;end
/* The line below places "cursor" on the default button */
transmit at(xc.bu,yc.bu)'r1'but.bu'r0';return
MOVE:;bu=arg(1);transmit at(xc.oldbu,yc.oldbu)but.oldbu||at(xc.bu,yc.bu)'r1'but.bu'r0';return
/* The following four routines are right from the CNet Amiga ToolKit! */
AT:;return ''arg(1)';'arg(2)'H'
GETCURSOR:
do until key~='NOCHAR';maygetchar;key=result;end
if key~='1B'x then return key;maygetchar;key=result
if key="[" then do;maygetchar;key=result;end
if key='A' then return '8';if key='B' then return '2'
if key='C' then return '6';if key='D' then return '4'
return key
CHECK:;if ARG()&ARG(1)~='###PANIC' then return ARG(1)
getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return
logentry 'Lost Carrier in Sysop Note 3 Editor';bufferflush;exit
exit
SYNTAX:;ERROR:;IOERR:;e1=' c9Errorcf: ca'rc' cf(ca'errortext(rc)'cf)'
e2=' c9Linecf: ce'left(sigl,4)'c9Filecf:';gu 1311992;a=result
gu 1311960;b=result;c='cb"ce'a||b'cb"';e2=e2' 'c;tr e1;tr e2;logentry e1
logentry e2;e=sourceline(sigl);do while e~='';e3='c9Sourcecf: cd'
e3=e3||left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
/** Last Edited: 15-MAR-97 ************************************************\
\************************************ Bad Obsession - +44-(0)1243-373596 **/